#ifndef UIFRIENDMODEL_H
#define UIFRIENDMODEL_H

#include <QObject>

namespace IM_GUI_KIT {

    class UIFriendModel:public QObject
    {
        Q_OBJECT
        // 好友id
        Q_PROPERTY(QString friendId READ getSession WRITE setSession NOTIFY sessionChanged);
        // 好友名称
        Q_PROPERTY(QString name READ getName WRITE setName NOTIFY nameChanged);
        // 好友头像
        Q_PROPERTY(QString iconUser READ getIcon WRITE setIcon NOTIFY iconChanged);
        // 好友的 签名时间
        Q_PROPERTY(QString time READ getTimeNow WRITE setTimeNow NOTIFY timeNowChanged);
        // 好友的 签名摘要
        Q_PROPERTY(QString summary READ getSummary WRITE setSummary NOTIFY summaryChanged);
        // 消息未读数 暂定
        Q_PROPERTY(int unread READ getUnread WRITE setUnread NOTIFY unreadChanged);

    signals:

        void sessionChanged();
        void nameChanged();
        void iconChanged();
        void timeNowChanged();
        void summaryChanged();
        void unreadChanged();
    private:
        QString m_sessionId;
        QString m_name;
        QString m_icon;
        QString m_summary;
        QString m_timeNow;
        int m_unread;
        int64_t m_timestamp;
    public:
        UIFriendModel(QObject *parent = nullptr);
        ~UIFriendModel();
        UIFriendModel(const QString sessionid, const QString &name, const QString &icon, const int64_t timestamp, const QString summary, int unRead, QObject *parent=nullptr);
        QString getSession()const;
        void setSession(const QString &sessionid);
        QString getName()const;
        void setName(const QString &name);
        QString getIcon()const;
        void setIcon(const QString &icon);
        QString getTimeNow()const;
        void setTimeNow(const QString &timeNow);
        QString getSummary()const;
        void setSummary(const QString &summary);
        int getUnread();
        void setUnread(const int &unread);
    };
}

#endif // UIFRIENDMODEL_H
